<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.54">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #843424}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #902f20}
span.s1 {font: 18.0px Helvetica}
span.s2 {color: #1949e0}
span.s3 {color: #0d32ac}
span.s4 {color: #4c6724}
span.s5 {color: #000000}
span.s6 {color: #062cb0}
span.s7 {color: #606060}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="s1"><b>RedLbyl<span class="Apple-tab-span">	</span></b></span><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>look before you leap</b></p>
<p class="p2"><br></p>
<p class="p1"><b>Inherits from: </b><a href="SC://Filter"><span class="s2"><b>Filter</b></span></a></p>
<p class="p2"><br></p>
<p class="p1">an implementation of Matt Wright's MaxMSP object [lbyl].</p>
<p class="p1">it can be used for filtering sensor data as well as removing clicks in audio signals.</p>
<p class="p2"><br></p>
<p class="p1"><b><span class="Apple-tab-span">	</span>*kr(in, thresh, samples)</b></p>
<p class="p1"><b><span class="Apple-tab-span">	</span>*ar(in, thresh, samples)</b></p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>in - signal to be filtered.</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>thresh - threshold.<span class="Apple-converted-space">  </span>(tolerance).</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>samples - number of samples that must be received before making the jump.<span class="Apple-converted-space">  </span>(quota).</p>
<p class="p1"><span class="Apple-tab-span">	</span><b>lbyl(in, thresh, samples)</b></p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>language side</p>
<p class="p3"><br></p>
<p class="p3"><br></p>
<p class="p4">//--</p>
<p class="p5">s.boot;</p>
<p class="p3"><br></p>
<p class="p5">b= <span class="s3">Buffer</span>.sendCollection(s, [0.1, 0.1, 0.1, 1, 0.2, 0.2, 0.2, 1, 1, 0.3, 0.3, 0.3, 0.3, 1, 1, 1, 0.4, 0.4, 0.4, 0.4])</p>
<p class="p5">{a= <span class="s3">PlayBuf</span>.kr(1, b); [a, <span class="s3">RedLbyl</span>.kr(a)]}.plot(0.03)</p>
<p class="p5">{a= <span class="s3">PlayBuf</span>.ar(1, b); [a, <span class="s3">RedLbyl</span>.ar(a)]}.plot(0.0005)</p>
<p class="p5">b.free;</p>
<p class="p3"><br></p>
<p class="p3"><br></p>
<p class="p4">//--</p>
<p class="p5">{<span class="s3">SinOsc</span>.ar(<span class="s3">RedLbyl</span>.kr(<span class="s3">MouseX</span>.kr(400, 4000, <span class="s4">'exponential'</span>), 20, 300), 0, 0.5)}.play</p>
<p class="p3"><br></p>
<p class="p6"><span class="s5">{a= </span><span class="s6">Dust</span><span class="s5">.ar(5); [a, </span><span class="s6">RedLbyl</span><span class="s5">.ar(a, 0.1, 2)]}.play<span class="Apple-tab-span">	</span></span>//no clicks above 0.1 or below -0.1 in right chan</p>
<p class="p3"><br></p>
<p class="p5">{a= <span class="s3">LFPulse</span>.ar(2, 0, <span class="s3">MouseX</span>.kr, 0.5); <span class="s3">SinOsc</span>.ar([400, 404], 0, [a, <span class="s3">RedLbyl</span>.ar(a, <span class="s3">MouseY</span>.kr, 5000)])}.play</p>
<p class="p3"><br></p>
<p class="p3"><br></p>
<p class="p4">//--</p>
<p class="p5">b= [0.1, 0.1, 0.1, 1, 0.2, 0.2, 0.2, 1, 1, 0.3, 0.3, 0.3, 0.3, 1, 1, 1, 0.4, 0.4, 0.4, 0.4]</p>
<p class="p5">a= <span class="s3">RedLbyl</span>.new</p>
<p class="p5">b.do{<span class="s3">|x|</span> [x, a.lbyl(x)].postln}; <span class="s7">""</span></p>
</body>
</html>
